<template>
  <view @click="handClick">
    <view class="cu-card case">
      <view class="cu-item shadow">
        <view class="image">
          <!-- 图片开始 -->
          <image v-if="item.imgUrl" :src="item.imgUrl" mode="aspectFix" lazy-load />
          <!-- 图片结束 -->
		   <!-- 图片左上角图标开始 -->		  
       <view v-if="item.like!=0">
		  <view class="cu-tag-right bg-cyan"
		    style="">{{item.like}}个点赞</view>
        </view>
		  <!-- 图片左上角图标结束 -->
           <!-- 图片右上角图标开始 -->

          <view class="cu-tag bg-orange">{{item.type}}</view>
          
          <!-- 图片右上角图标结束 -->
          <!-- 图片标题开始 -->
          <view class="cu-bar bg-shadeBottom">
            <text class="text-cut title_name">{{item.name}}</text>
          </view>
          <!-- 图片标题结束 -->
        </view>
      </view>
    </view>
  </view>
</template>

<script>
export default {
  props: {
    item: Object,
    index: Number
  },
  methods: {
    handClick() {
      //console.log("点");
      uni.navigateTo({
        url: `/pagesB/courseDetail/index?id=${this.item.id}
        &imgUrl=${this.item.imgUrl}&type=${this.item.type}`
      });
    }
  }
};
</script>

<style lang="scss" scoped>
.img_item {
  image {
    height: 300rpx;
  }
}
.title_name {
  //省略
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
}
.cu-tag-right {
	font-size: 24upx;
	vertical-align: middle;
	position: absolute;
	left: 0upx;
	top: 0upx;
  border-radius: 20rpx;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	box-sizing: border-box;
	padding: 0upx 16upx;
	height: 48upx;
	font-family: Helvetica Neue, Helvetica, sans-serif;
	white-space: nowrap;	

}
</style>
